﻿using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

// Token: 0x0200013F RID: 319
[AddComponentMenu("RVP/C#/Demo Scripts/Performance Stats", 1)]
public class PerformanceStats : MonoBehaviour
{
	// Token: 0x060005D1 RID: 1489 RVA: 0x0002E5BC File Offset: 0x0002C7BC
	private void Update()
	{
		this.fpsUpdateTime = Mathf.Max(0f, this.fpsUpdateTime - Time.deltaTime);
		if (this.fpsUpdateTime == 0f)
		{
			this.fpsText.text = "FPS: " + this.frames.ToString();
			this.fpsUpdateTime = 1f;
			this.frames = 0;
		}
		else
		{
			this.frames++;
		}
	}

	// Token: 0x060005D2 RID: 1490 RVA: 0x0002E640 File Offset: 0x0002C840
	public void Restart()
	{
		SceneManager.LoadScene(SceneManager.GetActiveScene().name);
		Time.timeScale = 1f;
	}

	// Token: 0x0400088F RID: 2191
	public Text fpsText;

	// Token: 0x04000890 RID: 2192
	private float fpsUpdateTime;

	// Token: 0x04000891 RID: 2193
	private int frames;
}
